import './assets/styles/app.scss'
import './assets/styles/uecss.scss'
import Vue from 'vue'
import App from './App.vue'
Vue.prototype.$eventBus = new Vue()
import api from '@/utils/api'
Vue.prototype.$api = api
import axios from 'axios'
Vue.prototype.$axios = axios

import L from 'leaflet'
import 'leaflet/dist/leaflet.css'
Vue.prototype.$L = L
//引入第三方字体包
import "@/assets/fonts/font.css"
import router from './router'
import store from './store'
import Element from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(Element, { size: 'small' })
import './assets/styles/element-over/index.scss' // 样式替换
// 引入echart
import * as echarts from 'echarts'
Vue.prototype.$echarts = echarts
Vue.config.productionTip = false
import moment from 'moment'
Vue.prototype.$moment = moment
import config from '@/settings'
Vue.prototype.$config = config
import lodash from 'lodash'
Vue.prototype._lodash = lodash;
import CountTo from 'vue-count-to'
Vue.use(CountTo)
import InfiniteLoading from 'vue-infinite-loading'
import FrameLayout from './views/components/FrameLayout'
import Frame from './views/components/Frame'
import TwoThree from './views/components/TwoThree'
import Dlgdiv from './views/components/Dlgdiv';
import Dlgdivv from './views/components/Dlgdivv'
import Dialog from './views/components/Dialog'
import DlgdivCreat from './views/components/DlgdivCreat'
import DlgdivTip from './views/components/DlgdivTip'
import DlgdivMap01 from './views/components/DlgdivMap01'

import { formatTimeAllBr } from '@/utils/timeformat.js';
import { areaKmToM } from '@/utils/index.js';

//村庄详情
import dlgyyfxd from '@/views/components/dlgyyfxd.vue'
const install = {
    install: function(Vue) {
        Vue.component('FrameLayout', FrameLayout)
        Vue.component('Frame', Frame)
        Vue.component('TwoThree', TwoThree)
        Vue.component('Dlgdiv', Dlgdiv)
        Vue.component('Dialog', Dialog)
        Vue.component('InfiniteLoading', InfiniteLoading)
        Vue.component('Dlgdivv', Dlgdivv);
        Vue.component('Dlgyyfxd', dlgyyfxd)
        Vue.component('DlgdivCreat', DlgdivCreat)
        Vue.component('DlgdivTip', DlgdivTip)
        Vue.component('DlgdivMap01', DlgdivMap01)
        
    }
}

Vue.prototype.formatTimeAllBr = formatTimeAllBr
Vue.prototype.areaKmToM = areaKmToM
import storeTool from './map/cesium/lib/indexedStore'
storeTool.init()
Vue.prototype.$iDB = storeTool // 洪水分析
Vue.prototype.$SPbus = new Vue() // 洪水分析
Vue.use(install)
Vue.filter('dateformat', function(dataStr, pattern = 'YYYY年MM月DD日 HH:mm:ss') {
    if (dataStr) {
        return moment(dataStr).format('YYYY-MM-DD HH:mm')
    } else {
        return null
    }
})
new Vue({
    router,
    store,
    render: h => h(App)
}).$mount('#app')
window.cancelApi = {}
